<? $data = array(
    '1' => 'Accepted',
    '2' => 'Wrong answer',
    '3' => 'Time limit exceeded',
    '4' => 'Presentation Error',
    '5' => 'Compilation error',
    '6' => 'Memory limit exceeded',
    '7' => 'Runtime error',
    '8' => 'Compiling',
    '9' => 'Running',
    '10' => 'Waiting'
);
?>
<div align="center"> <?= $this->title; ?> </div>
<? if(count($this->paginator)): ?>
    <?= $this->paginationControl($this->paginator, 'Sliding', 
                'partials/my_paginator.phtml'); ?>
    <table border="1" width="100%">
        <tr>
            <th> ID </th>
            <th> Дата </th>
            <th> Автор </th>
            <th> Задача </th>
            <th> Язык </th>
            <th> Результат </th>
            <th> Тест </th>
            <th> Время </th>
            <th> Память </th>
        </tr>
        <? foreach ($this->paginator as $value): ?>
        <tr>
            <td> 
                <? if (Zend_Auth::getInstance()->hasIdentity()) :?>
                    <? if(Zend_Auth::getInstance()->getIdentity()->user_id == $value['user_id']) : ?>
                          <a href="<?= $this->url(array(
                              'module' => 'system',
                              'controller' => 'status',
                              'action' => 'source',
                              'id' => $value['source_id']
                          )); ?>"> <?= $value['status_id']; ?> </a>
                    
                    <? else :?>
                        <?= $value['status_id']; ?>
                    <? endif; ?>
                <? else : ?>
                    <?= $value['status_id']; ?>
                <? endif;?>
            </td>
            <td><?= date("d.m.Y H:i:s", $value['date']); ?></td>
            <td><?= $value['user_name']; ?> <?=$value['user_surname']; ?>  </td>
            <td><?= $value['problem_title']; ?></td>
            <td> C++ <!--// $value['lang_prog_title']; --></td>
            <td style="color:
                            <? if ($value['result_id'] == 1) :?> 
                                #008000 
                            <? elseif ($value['result_id'] >= 2 && $value['result_id'] <= 7 ) :?> 
                                #E3170D 
                            <? endif; ?>">
                <?= isset($data[$value['result_id']]) ? $data[$value['result_id']] : $data[10] ; ?>
            </td>
            <td> <?= $value['test']; ?> </td>
            <td> <?= $value['time1']; ?> </td>
            <td> <?= $value['memory1']; ?> Кб</td>
        </tr>
        <? endforeach; ?>
    </table>
    <?= $this->paginationControl($this->paginator, 'Sliding', 
            'partials/my_paginator.phtml'); ?>
<? else :?>
    Пока еще отправленнх задач нет.
<? endif ?>
